<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8" />
  <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="./css/index.css">
  <title>Document</title>
  <style>
    #main {
      width: 800px;
      height: 600px;
      margin: auto;
    }
  </style>
</head>

<body>
  <div id="app">
      <div class="container">
        <div id="main"></div>
        <div class="button_fa">
            <button class="d-button mr-20" @click="downloadPdf">下载PDF</button>
            <button class="d-button danger" @click="close">关闭页面</button>
        </div>
      </div>
  </div>
  <script src="js/jspdf.min.js"></script>
  <script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
  <script src="js/echarts.min.js"></script>
  <script src="js/Dcharts.js"></script>
  <script src="js/common.js"></script>
  <script>
    const vue = new Vue({
      el: '#app',
      data: {

      },
      mounted() {
        let d = new Dcharts();
        try {
          d.drawChartsTwo('main',this.getUrldata("data"),this.getUrldata("head"));
        } catch (error) {
          console.log(error);
        }
       
      },
    //   http://127.0.0.1:5500/DemoBar.html?data={%22f1%22:[{%222012%22:%22222%22},{%222013%22:%22123%22},{%222014%22:%22100%22}],%22f2%22:[{%222012%22:%22111%22},{%222013%22:%2289%22},{%222014%22:%2290%22}],%22f3%22:[{%222012%22:%22333%22},{%222013%22:%2244%22},{%222014%22:%2222%22}]}
      methods:{
          getUrldata(name){
            return utils.getUrldata(name)
          },
          downloadPdf(){
                window.print()
          },
          close(){
            　 window.location.href="about:blank";
              window.close();
          }
      }
    });
  </script>
</body>

</html>